package com.share51.novel.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import lombok.*;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author gb
 * @since 2020-03-23
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("t_chapter")
public class Chapter extends Model<Chapter> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 状态
     */
    private Integer status;
    /**
     * 章节名
     */
    private String name;
    /**
     * 关联小说
     */
    @TableField("novel_id")
    private Integer novelId;
    /**
     * 关联章节内容
     */
    @TableField("content_id")
    private Integer contentId;
    /**
     * 章节排序
     */
    @TableField("order_index")
    private Integer orderIndex;
    /**
     * 采集小说地址
     */
    private String url;

    @TableField("create_user")
    private Integer createUser;

    @TableField("update_user")
    private Integer updateUser;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(exist = false)
    private Integer site;

    public Chapter(String name, String url, int orderIndex) {
        this.name=name;
        this.url=url;
        this.orderIndex=orderIndex;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
